package com.smm.web.vmc.api;

import com.smm.web.vmc.domain.AppInfo;
import com.smm.web.vmc.dto.JsonReturn;
import com.smm.web.vmc.service.AppInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by zhenghao on 2016/10/14.
 *
 * 手机客户端相关操作
 */
@Controller
@RequestMapping(value = "/api/app", method = RequestMethod.POST)
public class AppApi {


    @Resource
    private AppInfoService appInfoService;


    @RequestMapping("/version.do")
    @ResponseBody
    public JsonReturn version(){

        try{

            //查询手机客户端当前版本号
            AppInfo appInfo = appInfoService.getLastInfo();

            return new JsonReturn(1,"",appInfo);

        }catch (Exception e){

            e.printStackTrace();

            return new JsonReturn(0,e.getMessage());
        }

    }



}
